import request from "./index";

/** 获取题目 */
export async function getQuestionById(data: any) {
  return request<API.QuestionProps>("/question/queryById", data);
}

/** 获取题目列表 */
export async function getQuestionIndexList() {
  return request<API.QuestionIndexItem[]>("/question/queryIndexList");
}

/** 获取考试状态 */
export async function getExamStatus() {
  return request<API.ExamStatus>("/exam/status");
}

/** 提交考试 */
export async function submitExam() {
  return request<string>("/exam/submit");
}

/** 提交答案 */
export async function saveAnswer(data: any) {
  return request<string>("/exam/saveAnswer", data, "POST");
}

/** 获取测评结果 */
export async function getExamDetail(id: number) {
  return request<API.ExamResultProps>(
    `/exam/result?studentId=${id}`,
    {},
    "POST"
  );
}

/** 人脸校验 */
export async function approveFile(data: any) {
  return request<string>("/exam/approve", data, "POST");
}

// 班级测评概览
export async function detailClass(data: any) {
  return request<API.TableResProps<API.ExamDetailClassItem[]>>(
    "/exam/detail-class",
    data
  );
}

/** 圆形统计图 */
export async function CirChartStat() {
  return request<API.ChartStatItem[]>("/exam/cirChart-stat");
}

/** 学校数据详情 */
export async function schoolDetail() {
  return request<API.GroupBarRes[]>("/exam/detail-school");
}
